package editor.common
{
	import editor.map.minimap.Minimap;
	import editor.ui.GatesInfoWindow;
	import editor.ui.LayerControllerWindow;
	import editor.ui.OutputWindow;
	import editor.ui.TileInfoWindow;
	import editor.ui.ToolWindow;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.utils.Dictionary;
	
	import mx.core.Singleton;
	import mx.states.AddChild;
	

	public class UIManager
	{
		private static var __instance:UIManager;
		
		private var _uiLayer:Sprite;
		
		public var tileInfoWindow:TileInfoWindow;
		public var layerControllerWindow:LayerControllerWindow;
		public var outputWindow:OutputWindow;
		public var toolWindow:ToolWindow;
		public var gatesInfoWindow:GatesInfoWindow;
		public var miniMap:Minimap;
		
		public static function getInstance():UIManager
		{
			if(__instance == null)
				__instance = new UIManager(new Singleton());
			return __instance;
		}
		
		public function UIManager(s:Singleton)
		{
			
		}
		
		public function bindContianer(container:DisplayObjectContainer):void
		{
			_uiLayer = new Sprite();
			container.addChild(_uiLayer);
			
			initWindows();
		}
	
		private function initWindows():void
		{
//			tileInfoWindow 			= new TileInfoWindow(_uiLayer, 20, 40); 
			layerControllerWindow 	= new LayerControllerWindow(_uiLayer);
			outputWindow 			= new OutputWindow(_uiLayer, 1210, 40);
			outputWindow.isAutoSize = true;
			outputWindow.xpct		= 20;
			
			toolWindow 				= new ToolWindow(_uiLayer, 1210, 160);
			toolWindow.isAutoSize	= true;
			toolWindow.xpct			= 20;
			
			gatesInfoWindow				= new GatesInfoWindow(_uiLayer, 1210, 465);
			gatesInfoWindow.isAutoSize 	= true;
			gatesInfoWindow.xpct	   	= 20;
		}
		//
	}
}

class Singleton
{}